package lucid.hrms.management.nationality;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("nationalityService")
public class NationalityServiceImpl implements NationalityService {
	@Autowired
	private NationalityRepository nationalityRepository;

	@Transactional(propagation = Propagation.REQUIRED)
	public Nationality saveNationality(Nationality nationality) {
		return nationalityRepository.merge(nationality);
	}

	@Transactional(readOnly = true)
	public List<Nationality> findNationalities(
			NationalityCriteria nationalityCriteria, int firstResult,
			int maxResults) {
		return nationalityRepository.findNationalities(nationalityCriteria,
				firstResult, maxResults);
	}

}